/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.gastronomico.demo.web;

import com.gastronomico.demo.domain.Afiliacion;
import com.gastronomico.demo.repository.AfiliacionRepository;
import com.gastronomico.demo.service.AfiliacionService;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

/**
 *
 * @author mmuguerza
 */

@Controller
public class AfiliacionController {

    @Autowired
    AfiliacionService service;

    @RequestMapping(value="/afiliacionxEstablecimientoLista.htm",method=RequestMethod.GET)
    public ModelAndView afiliacion(HttpServletRequest req){
        ModelAndView mav = new ModelAndView("afiliacionLista");
        String id = req.getParameter("id");
        List<Afiliacion> lista = service.obtenerxEstablecimiento(id);
        mav.addObject("afiliacionLista", lista);
        return mav;
    }
/*
    @RequestMapping(value="/afiliacionxUsuarioLista2.htm",method=RequestMethod.GET)
    public ModelAndView afiliacion(HttpServletRequest req){
        ModelAndView mav = new ModelAndView("afiliacionLista");
        String id = req.getParameter("id");
        List<Afiliacion> lista = service.obtenerxEstablecimiento(id);
        mav.addObject("afiliacionLista", lista);
        return mav;
    }
*/
}
